﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MWRCommunicationLibrary
{
    /// <summary>
    /// 参数解析
    /// </summary>
    public class ParamDecodorAttribute : Attribute
    {
        /// <summary>
        /// 起始位置
        /// </summary>
        public int StartIndex;

        /// <summary>
        /// 长度
        /// </summary>
        public int Length;

        /// <summary>
        /// 分辨率
        /// </summary>
        public double Res;

        /// <summary>
        /// 偏移
        /// </summary>
        public double Offset;

        public ParamDecodorAttribute(int start, int len)
        {
            this.StartIndex = start;
            this.Length = len;
            this.Offset = 0;
            this.Res = 1;
        }

        public ParamDecodorAttribute(int start, int len, double res, double off)
        {
            this.StartIndex = start;
            this.Length = len;
            this.Offset = off;
            this.Res = res;
        }
    }
}
